<template>

<div>


  <h3 style="text-align:center">上报记录</h3>
  <div style="width: 70%;margin: auto;">
  <div class="block">

    <div class="radio">
      顺序：
      <el-radio-group v-model="reverse">
        <el-radio :label="true">倒序</el-radio>
        <el-radio :label="false">正序</el-radio>
      </el-radio-group>
    </div>
    <br>

    <el-empty v-show="reportList.length!=0?true:false"description="无上报数据"></el-empty>
    <el-timeline :reverse="reverse">
      <el-timeline-item  placement="top"
                        v-for="(report, index) in reportList"
                        :key="index"
                        :timestamp="report.reportDate">
        <el-card>
          <h4>上报 健康 数据</h4>
          <p>{{report.name}} 提交于 {{report.reportDate}}</p>
          <p>健康状态：{{report.healthCon}}</p>
          <p>备注：{{report.remark===''?'无':report.remark}}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>

  </div>
  </div>
</div>




</template>


<script>
import {getUserReportList} from "@/views2/api/myselfManager";
import jwtDecode from "jwt-decode";
import {getToken} from "@/utils/auth";

export default {
  name: "index",
  components:{
  },
  data() {
    return {
      reverse:false,
      reportList:[]
    }
  },
  watch: {


  },

  computed:{

  },
  methods: {

    getUserReportList(){
      getUserReportList(jwtDecode(getToken()).userId).then(res=>{

        let arr=res.data.data;

        this.reportList=arr


      }).catch(error=>{})

    },



  },
  mounted() {
    //
    this.getUserReportList();
  }

}
</script>

<style scoped>
.list{

  max-height: 50px;
}
</style>
